<div class="main-title clearfix">
    <h1>Company Information</h1>
</div>
<div class="grid_16">
    <div class="admin-agency form">
		<?php
		$form = $this->beginWidget('CActiveForm', array(
			'id' => 'admin-agency-update-form',
			'enableAjaxValidation' => FALSE,
			'htmlOptions' => array(
				'enctype' => 'multipart/form-data',
			)
		));
		?>
        <div class="section">
			<div class="block">
				<h2>
					<img src="/images/icons/farmfresh/32x32/information.png" />
					Organisation Information
				</h2>
				<table class="form-table">
					<tr>
						<th width="150" scope="row" class="align-right">
							<label><?php echo $agency->type; ?> Name</label>
						</th>
						<td>
							<div class="">
								<?php echo $agency->name; ?>
							</div>

						</td>
					</tr>
					<tr>
						<th width="150" scope="row" class="align-right">
							<?php echo $form->labelEx($agency, 'registration_number'); ?>
						</th>
						<td>
							<div class="">
								<?php echo $agency->registration_number ? $agency->registration_number : '-'; ?>
							</div>

						</td>
					</tr>
					<tr>
						<th width="150" scope="row" class="align-right">
							<?php echo $form->labelEx($agency, 'acra_number'); ?>
						</th>
						<td>
							<div class="">
								<?php echo $form->textField($agency, 'acra_number'); ?>
								<?php echo $form->error($agency, 'acra_number'); ?>
							</div>
						</td>
					</tr>
					<tr>
						<th width="150" scope="row" class="align-right">
							<?php echo $form->labelEx($agency, 'gst_registered'); ?>
						</th>
						<td>
							<div class="">
								<?php echo $form->checkbox($agency, 'gst_registered'); ?>
								<?php echo $form->error($agency, 'gst_registered'); ?>					
							</div>
						</td>
					</tr>
					<tr>
						<th width="150" scope="row" class="align-right">
							<?php echo $form->labelEx($agency, 'gst_registration_number'); ?>
						</th>
						<td>
							<div class="">
								<?php echo $form->textField($agency, 'gst_registration_number', array('maxlength' => 255)); ?>
								<?php echo $form->error($agency, 'gst_registration_number'); ?>	
							</div>
						</td>
					</tr>
					<tr>
						<th width="150" scope="row" class="align-right">
							<?php echo $form->labelEx($agency, 'tagline'); ?>
						</th>
						<td>
							<div class="">
								<?php echo $form->textField($agency, 'tagline', array('size' => 45)); ?>
								<?php echo $form->error($agency, 'tagline'); ?>
								<p class="hint no-margin">
									E.g. Your number 1 Singapore Real Estate Company
								</p>
							</div>
						</td>
					</tr>
				</table>
				<div class="form-buttons">
					<button type="submit" class="link-button round_all no-margin">
						<span>Save Changes</span>
					</button>
				</div>
			</div>
		</div>
		<div class="section">
			<div class="block">
				<h2>
					<img src="/images/icons/farmfresh/32x32/telephone.png" />
					Contact Information
				</h2>
				<table class="form-table">
					<tr>
						<th width="150" scope="row" class="align-right">
							<?php echo $form->labelEx($agency, 'address_1', array('label' => 'Address')); ?>
						</th>
						<td>
							<div class="form-table-block">
								<?php echo $form->textField($agency, 'address_1', array('size' => 50)); ?>
								<?php echo $form->error($agency, 'address_1'); ?>
							</div>
						</td>
					</tr>
					<tr>
						<th width="150" scope="row" class="align-right">
						</th>
						<td>
							<div class="form-table-block">
								<?php echo $form->textField($agency, 'address_2', array('size' => 50)); ?>
								<?php echo $form->error($agency, 'address_2'); ?>
							</div>
						</td>
					</tr>
					<tr>
						<th width="150" scope="row" class="align-right">
							<?php echo $form->labelEx($agency, 'country_id'); ?>
						</th>
						<td>
							<div class="form-table-block">
								<?php
								echo $form->dropDownList($agency, 'country_id', Country::getCountryListData(), array(
									'prompt' => 'Select Country',
									'options' => array('separator1' => array('disabled' => true), 'separator2' => array('disabled' => true))
								));
								?>
								<?php echo $form->error($agency, 'country_id'); ?>
							</div>
						</td>
					</tr>
					<tr>
						<th width="150" scope="row" class="align-right">
							<?php echo $form->labelEx($agency, 'postcode'); ?>
						</th>
						<td>
							<div class="form-table-block">
								<?php echo $form->textField($agency, 'postcode', array('size' => 15)); ?>
								<?php echo $form->error($agency, 'postcode'); ?>
							</div>
						</td>
					</tr>
	<!--                <tr>
						<th width="150" scope="row" class="align-right">
					<?php echo $form->labelEx($agency, 'country_id'); ?>
						</th>
						<td>
							<div class="form-table-block">
					<?php
					echo $agency->country->name;
					?>
							</div>
						</td>
					</tr>-->

					<tr>
						<th width="150" scope="row" class="align-right">
							<?php echo $form->labelEx($agency, 'address_1', array('label' => 'Display Address')); ?><br/>
							<label class="hint">Address to be shown in invoices and forms</label>
						</th>
						<td>
							<div class="form-table-block">
								<?php echo $form->textArea($agency, 'address_formatted', array('rows' => 4, 'cols' => 50)); ?>
								<?php echo $form->error($agency, 'address_formatted'); ?>

							</div>
						</td>
					</tr>
					<tr>
						<th width="150" scope="row" class="align-right">
							<?php echo $form->labelEx($agency, 'phone'); ?>
						</th>
						<td>
							<div class="form-table-block">
								<?php echo $form->textField($agency, 'phone', array('size' => 15)); ?>
								<?php echo $form->error($agency, 'phone'); ?>
							</div>
						</td>
					</tr>
					<tr>
						<th width="150" scope="row" class="align-right">
							<?php echo $form->labelEx($agency, 'fax'); ?>
						</th>
						<td>
							<div class="form-table-block">
								<?php echo $form->textField($agency, 'fax', array('size' => 15)); ?>
								<?php echo $form->error($agency, 'fax'); ?>
							</div>
						</td>
					</tr>
					<tr>
						<th width="150" scope="row" class="align-right">
							<?php echo $form->labelEx($agency, 'admin_email'); ?>
						</th>
						<td>
							<div class="form-table-block">
								<?php echo $form->textField($agency, 'admin_email', array('size' => 50)); ?>
								<?php echo $form->error($agency, 'admin_email'); ?>
							</div>
						</td>
					</tr>
				</table>
				<div class="form-buttons">
					<button type="submit" class="link-button round_all no-margin">
						<span>Save Changes</span>
					</button>
				</div>
			</div>
        </div>
		<div class="section">
			<div class="block">
				<h2>
					<img src="/images/icons/farmfresh/32x32/bank.png" />
					Bank Information
				</h2>
				<div class="form-buttons">
					<table class="form-table">
						<tr>
							<th scope="row" width="150" class="align-right">
								<?php echo $form->labelEx($agency, 'bank_name', array('label' => 'Bank')); ?>
							</th>
							<td>
								<div class="form-table-block">
									<?php echo $form->labelEx($agency, 'bank_name'); ?>
									<?php echo $form->textField($agency, 'bank_name', array('size' => 45, 'maxlength' => 255)); ?>
									<?php echo $form->error($agency, 'bank_name'); ?>
									<p class="hint no-margin">E.g. DBS</p>
								</div>

								<div class="form-table-block">
									<?php echo $form->labelEx($agency, 'bank_code'); ?>
									<?php echo $form->textField($agency, 'bank_code', array('size' => 10, 'maxlength' => 20)); ?>
									<?php echo $form->error($agency, 'bank_code'); ?>
									<p class="hint no-margin">E.g. 7171</p>
								</div>
							</td>
						</tr>
						<tr>
							<th scope="row" width="150" class="align-right">
								<?php echo $form->labelEx($agency, 'bank_branch'); ?>
							</th>
							<td>
								<div class="form-table-block">
									<?php echo $form->labelEx($agency, 'bank_branch', array('label' => 'Branch Name')); ?>
									<?php echo $form->textField($agency, 'bank_branch', array('size' => 45, 'maxlength' => 255)); ?>
									<?php echo $form->error($agency, 'bank_branch'); ?>
									<p class="hint no-margin">E.g. Ang Mo Kio Branch</p>
								</div>

								<div class="form-table-block">
									<?php echo $form->labelEx($agency, 'bank_branch_code', array('label' => 'Branch Number')); ?>
									<?php echo $form->textField($agency, 'bank_branch_code', array('size' => 10, 'maxlength' => 20)); ?>
									<?php echo $form->error($agency, 'bank_branch_code'); ?>
									<p class="hint no-margin">E.g. 081</p>
								</div>
							</td>
						</tr>
						<tr>
							<th scope="row" class="align-right">
								<?php echo $form->labelEx($agency, 'bank_account_name'); ?>
							</th>
							<td>
								<?php echo $form->textField($agency, 'bank_account_name', array('size' => 45, 'maxlength' => 30)); ?>
								<?php echo $form->error($agency, 'bank_account_name'); ?>
								<p class="hint no-margin">E.g. <?php echo $agency->name; ?></p>
							</td>
						</tr>
						<tr>
							<th scope="row" class="align-right">
								<?php echo $form->labelEx($agency, 'bank_account_no'); ?>
							</th>
							<td>
								<?php echo $form->textField($agency, 'bank_account_no', array('size' => 16, 'maxlength' => 30)); ?>
								<?php echo $form->error($agency, 'bank_account_no'); ?>
								<p class="hint no-margin">E.g. 123-456-789-0</p>
							</td>
						</tr>
						<tr>
							<th scope="row" class="align-right">
								<?php echo $form->labelEx($agency, 'bank_owner_contact'); ?>
							</th>
							<td>
								<?php echo $form->textField($agency, 'bank_owner_contact', array('size' => 16, 'maxlength' => 30)); ?>
								<?php echo $form->error($agency, 'bank_owner_contact'); ?>
							</td>
						</tr>
						<tr>
							<th scope="row" class="align-right">
								<?php echo $form->labelEx($agency, 'bank_owner_address'); ?>
							</th>
							<td>
								<?php echo $form->textArea($agency, 'bank_owner_address', array('cols' => '45', 'rows' => 4)); ?>
								<?php echo $form->error($agency, 'bank_owner_address'); ?>
							</td>
						</tr>
					</table>
					<button type="submit" class="link-button round_all no-margin">
						<span>Save Changes</span>
					</button>
				</div>
			</div>
		</div>
		<?php $this->endWidget(); ?>
    </div><!-- form -->
</div>